
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">
		<h:form>
			<p:toolbar>
				<p:toolbarGroup align="left">
					
					<!-- <p:commandButton title="#{messages['button.delete']}" icon="ui-icon-trash" onclick="confirmation.show()"
						type="button" immediate="true" ajax="false" /> -->

					<p:confirmDialog message="#{messages['label.confirm.delete']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.alert']}!" severity="alert" widgetVar="confirmation">

						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{tbClienteListMB.deleteSelection}"
							actionListener="#{tbClienteListMB.clear}" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="confirmation.hide()" type="button" />
					</p:confirmDialog>
				</p:toolbarGroup>
			</p:toolbar>
			<p:dataTable id="list" var="bean" value="#{tbClienteListMB.resultList}" emptyMessage="Nenhum cliente encontrado" paginator="true" rows="10">
				
				<f:facet name="header">#{messages['tbCliente.list.table.title']}</f:facet>
				<p:column style="width:1%;">
					<h:selectBooleanCheckbox value="#{tbClienteListMB.selection[bean.id]}"></h:selectBooleanCheckbox>
				</p:column>
				
				<p:column sortBy="#{bean.nmCliente}">
					<f:facet name="header">#{messages['tbCliente.label.nmCliente']}</f:facet>
					<h:commandLink action="#{tbClienteListMB.getNextView}" actionListener="#{tbClienteListMB.clear}">
						<h:outputText value="#{bean.nmCliente}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
				
				<p:column headerText="#{messages['tbCliente.label.dtNascimento']}" >
						<h:outputText value="#{bean.dtNascimento}" >
							<f:convertDateTime pattern="dd/MM/yyyy"/>
						</h:outputText>
				</p:column>
				
				<p:column headerText="#{messages['tbCliente.label.nmBairro']}">
						<h:outputText value="#{bean.nmBairro}" />
				</p:column>
						
				<p:column headerText="#{messages['tbCliente.label.nuTelefone']}">
						<h:outputText value="#{bean.nuTelefone}" />
				</p:column>
						
				<p:column headerText="#{messages['tbCliente.label.nmEmail']}">
						<h:outputText value="#{bean.nmEmail}" />
				</p:column>
						
			</p:dataTable>
		</h:form>

	</ui:define>
</ui:composition>